import request from "@/utils/request";

// 获取所有手机品牌数据
export function getAllPhoneBrand(query) {
  return request({
    url: "/pekingFish/brands/enable-list",
    method: "get",
    params: query,
  });
}

// 获取手机型号表格数据
export function getPhoneModelTable(query) {
  return request({
    url: "/pekingFish/phone-models/page",
    method: "get",
    params: query,
  });
}

// 新增手机型号
export function addPhoneModelInfo(data) {
  return request({
    url: "/pekingFish/phone-models",
    method: "post",
    data: data,
  });
}

// 删除手机型号表格数据
export function deletePhoneModelInfo(data) {
  return request({
    url: "/pekingFish/phone-models/batch",
    method: "delete",
    data: data,
  });
}

// 导入手机型号
export function importPhoneModelList(data) {
  return request({
    url: "/pekingFish/phone-models/import",
    method: "post",
    data: data,
  });
}
// 编辑表格手机型号
export function editPhoneModelInfo(data) {
  return request({
    url: "/pekingFish/phone-models",
    method: "put",
    data: data,
  });
}


// 导入模板
export function importPhoneModelTemplate() {
  return request({
    url: "/pekingFish/phone-models/get-import-template",
    method: "get",
    responseType: 'blob'
  });
}

// /查询参数获取手机型号列表
export function phoneModelsByParam(query) {
  return request({
    url: "/pekingFish/phone-models/listByParam",
    method: "get",
    params: query,
  });
}